<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>站内短信</title>
</head>
<div th:include="common/style"></div>
<body style="background: #f7f1e3;">
<table style="background: #c0a16b;">
    <tr th:each="l1:${unReadLetters}">
        <td th:text="${l1.LTitle}" style="width: 20%"></td>
        <td th:utext="${l1.LContent}" style="width: 60%;"></td>
        <td style="width: 10%">
            <a th:href="@{updateLstatusRead(LId=${l1.LId})}">[已阅关闭]</a>
        </td>
    </tr>
</table>
<br>
<p>
    <input type="button" value="去发送短信" onclick="toSendLetter()" class="btn-primary">
</p>
<table border="1" style="text-align: center;">
    <tr style="background: black; color: white;">
        <td>状态</td>
        <td>发信人</td>
        <td>短信主题</td>
        <td>发信时间</td>
    </tr>
    <tr th:each="l2:${readLetters}">
        <td>已读</td>
        <td th:text="${l2.LSendername}"></td>
        <td style="width: 70%">
            <span th:text="${l2.LTitle}" style="color: green; cursor: pointer;"
                  th:content="${l2.LContent}" th:onclick="see(this.getAttribute('content'))"></span>
        </td>
        <td th:text="${l2.LSendtime}"></td>
    </tr>
</table>
</body>
<script>
    function see(content){
        alert(content);
    }
    function toSendLetter(){
        location.href = "toSendLetter";
    }
</script>
</html>